$('#login').click(function(){
    //取出用户输入的值
    var username=$('#username').val();
    var password=$('#userpsw').val();


    //取出localstorage中的用户名和密码
    var localname=localStorage.getItem('username');
    var localpsw=localStorage.getItem('password');

    if(username !== localname){
        alert('用户名不存在');
        return;
    }

    if(password !== localpsw){
        alert('密码错误，请重新输入！');
        return;
    }

    //登录成功直接跳转
    window.location.href='https://www.baidu.com/';//js页面跳转
});
